// 正文附件相关接口
import request from '@/utils/request';
/**
 * author:Suleyman
 */

// 附件预览接口
export function attachmentPreview(url) {
  return request({
    headers: {
      'Content-Type': 'application/json'
    },
    url: '/api/material/pre?name=' + url.substr(url.lastIndexOf('=') + 1),
    responseType: 'arraybuffer',
    method: 'get'
  })
}

// 附件下载接口
export function attachmentDownload(url) {
  return request({
    headers: {
      'Content-Type': 'application/json'
    },
    url: `/api/` + url,
    responseType: 'arraybuffer',
    method: 'get'
  })
}
